#ifndef OSGGridTool_H
#define OSGGridTool_H

#include <osg/Geode>
#include <osgGe/Vec3d>
#include <osg/LineWidth>
#include <osgText/Text>
#include <osg/MatrixTransform>
#include <osg/LightSource>
#include <osg/Image>
#include <osg/Geometry>
#include <osgGe/Vec3>
#include <osgGe/Vec4>
#include <osg/Billboard>

#include <osg/Projection>

//下列的函数把屏幕分成不同的单元网格,落入单元网格的数据元素可以调整大小

/**
 * @brief createGrid   生成一个单元格
 * @param left_bottom  输入左下角的坐标
 * @param right_top    输入右上角的坐标
 * @param width_div    输入宽
 * @param height_div   输入高
 * @return
 */
osg::ref_ptr<osg::Geode> createGrid(osg::Vec3f left_bottom, osg::Vec3f right_top, int width_div, int height_div);
osg::ref_ptr<osg::Projection> createNormalGrid(osg::Vec3f left_bottom, osg::Vec3f right_top, int width_div, int height_div);

/**
 * @brief createNormalCircle_   输入半径,终点,生成一个圆
 * @param radisu                半径
 * @param center                原点
 * @param color                 颜色
 * @return
 */
osg::ref_ptr<osg::Projection> createNormalCircle_(double radisu, osg::Vec3f center, osg::Vec4 color = osg::Vec4(0.0, 0.0, 1.0, 1.0));

/**
 * @brief createNormalLines 输入一系列点,前后相连,形成线
 * @param points            输入一系列点
 * @param color             输入一些列颜色
 * @return
 */
osg::ref_ptr<osg::Projection> createNormalLines(std::vector<osg::Vec3f>& points, osg::Vec4f color);

/**
 * @brief createNormalText  生成一系列文字
 * @param str               输入文字
 * @param center            输入位置
 * @return
 */
osg::ref_ptr<osg::Geode> createText(std::string str, osg::Vec3f pos, float size = 20, osg::Vec4 color = osg::Vec4(1.0, 0.0, 0.0, 1.0));

osg::ref_ptr<osg::Projection> createNormalText(std::vector<std::string>& str, std::vector<osg::Vec3f>& center);

osg::ref_ptr<osg::Projection> createNormalText(std::string str, osg::Vec3f center, float size = 20, osg::Vec4 color = osg::Vec4(1.0, 0.0, 0.0, 1.0));

osg::ref_ptr<osg::Projection> createNormalText(double num, osg::Vec3f center,  float size = 20, osg::Vec4 color = osg::Vec4(1.0, 0.0, 0.0, 1.0));
#endif


